m=8, x=9, j=1;
console.log (Math.min (m, j + (tz <= x)));
